package com.wits.platform.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
@Embeddable
public class MmrRoleResourcePK implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3666960303775610549L;

	private String roleId;
	
	private String rscId;
	
	public MmrRoleResourcePK(){
		
	}
	
	public MmrRoleResourcePK(String roleId,String rscId){
		this.roleId=roleId;
		this.rscId=rscId;
	}

	@Column(name="role_id",length=32)
	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	@Column(name="rsc_id",length=32)
	public String getRscId() {
		return rscId;
	}

	public void setRscId(String rscId) {
		this.rscId = rscId;
	}
	
    @Override 
    public int hashCode() { 
        final int prime = 31; 
        int result = 1; 
        result = prime * result + ((roleId == null) ? 0 : roleId.hashCode()); 
        result = prime * result    + ((rscId == null) ? 0 : rscId.hashCode()); 
        return result; 
    } 
 
    @Override 
    public boolean equals(Object obj) { 
        if (this == obj) 
            return true; 
        if (obj == null) 
            return false; 
        if (getClass() != obj.getClass()) 
            return false; 
        final MmrRoleResourcePK other = (MmrRoleResourcePK) obj; 
        if (roleId == null) { 
            if (other.roleId != null) 
                return false; 
        } else if (!roleId.equals(other.roleId)) 
            return false; 
            if (rscId == null) { 
                if (other.rscId != null) 
                    return false; 
            } else if (!rscId.equals(other.rscId)) 
                return false; 
        return true; 
    } 
}
